/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-03-30
 * Time: 17:36
 */
public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        String[] hobbies = {"打球", "阅读"};
        Address address = new Address("北京", "长安");
        DeepPerson original = new DeepPerson("赵六", hobbies, address);
        System.out.println("原始对象：" + original);
        //克隆对象
        DeepPerson cloned = (DeepPerson) original.clone();
        System.out.println("克隆对象：" + cloned);
        // 修改克隆对象
        cloned.name = "王五";
        cloned.hobbies[0] = "游戏";
        cloned.address.city = "上海";
        System.out.println("----------修改克隆对象后----------");
        System.out.println("原始对象: " + original);
        System.out.println("修改克隆对象: " + cloned);
    }
}
/*
输出：
        原始对象：赵六- 爱好：打球,阅读-地址：北京市长安路
        克隆对象：赵六- 爱好：打球,阅读-地址：北京市长安路
        ----------修改克隆对象后----------
        原始对象: 赵六- 爱好：打球,阅读-地址：北京市长安路
        修改克隆对象: 王五- 爱好：游戏,阅读-地址：上海市长安路*/
